*Paper: Fiscal Rules, Corruption and Electoral Accountability - Replication Files

clear all
cap log close 
set more off


**Global files
global folder "/Users/tommasogiommoni/Dropbox/Determinants of corruption/Stability pact and corruption/Replication files JOP"


********************************************************************************
****----						Dataset open 					    	----**** 
********************************************************************************

use "$folder/Data/dataset_feb2024.dta", clear

**-- Global

global controls7 proportion_female_Elected_lag av_education_Elected_lag av_age_Elected_lag  victory_margin_lag term_limit_lag 
global controls7_int  c.proportion_female_Elected_lag##i.anno c.av_education_Elected_lag##i.anno c.av_age_Elected_lag##i.anno c.victory_margin_lag##i.anno  c.term_limit_lag##i.anno

**-- Panel dataset

xtset codcom anno
fvset base 2012 anno

********************************************************************************
****----				Analysis: Event-study (first column)			----**** 
********************************************************************************

********--------  Analysis on Tax rate - house ordinary	--------********

quietly xtreg house_tax_ordinary S##anno population_anagrafe_V##post_2012 i.region_year P $controls7_int if abs(P)<3000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), fe vce(cluster codcom)
est store reg11
quietly xtreg house_tax_ordinary S##anno population_anagrafe_V##post_2012 i.region_year P $controls7_int if abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), fe vce(cluster codcom)
est store reg21
quietly xtreg house_tax_ordinary S##anno population_anagrafe_V##post_2012 i.region_year P $controls7_int if abs(P)<2000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), fe vce(cluster codcom)
est store reg31

coefplot (reg11, base offset(0) color(black) ciopts(recast(rcap) color(black black) lwidth(*0.75 *1.25)) label("BW: 3,000")) (reg21, offset(0.1) color(midblue) ciopts(recast(rcap) color(midblue midblue) lwidth(*0.75 *1.25)) label("BW: 2,500")) (reg31, offset(0.2) label("BW: 2,000")), vertical omitted keep(1.S#*.anno*)  yline(0) xline(9, lcolor(gray) lpattern(dash)) xlabel(1 "2004" 2 "2005" 3 "2006" 4 "2007" 5 "2008" 6 "2009" 7 "2010" 8 "2011" 9 "2012" 10 "2013" 11 "2014" 12 "2015",  angle(45)) ///
ms(m) color(eltblue) ciopts(recast(rcap) color(eltblue eltblue) lwidth(*0.75 *1.25)) ylabel(-0.1(0.025)0.1, angle(horizotal))  graphregion(color(white)) msize(small) levels(95 90) ytitle("") title("") legend(rows(1))
gr export "$folder/Figures/FigureA4_a.png" , replace 

********--------  Analysis on Current expenditures	--------********

quietly xtreg current_exp_PC S##anno i.region_year P $controls7_int if abs(P)<3000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), fe vce(cluster codcom)
est store reg1
quietly xtreg current_exp_PC S##anno i.region_year P $controls7_int if abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), fe vce(cluster codcom)
est store reg2
quietly xtreg current_exp_PC S##anno i.region_year P $controls7_int if abs(P)<2000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), fe vce(cluster codcom)
est store reg3

coefplot (reg1, base offset(0) color(black) ciopts(recast(rcap) color(black black) lwidth(*0.75 *1.25)) label("BW: 3,000")) (reg2, offset(0.1) color(midblue) ciopts(recast(rcap) color(midblue midblue) lwidth(*0.75 *1.25)) label("BW: 2,500")) (reg3, offset(0.2) label("BW: 2,000")), vertical omitted keep(1.S#*.anno*)  yline(0) xline(9, lcolor(gray) lpattern(dash)) xlabel(1 "2004" 2 "2005" 3 "2006" 4 "2007" 5 "2008" 6 "2009" 7 "2010" 8 "2011" 9 "2012" 10 "2013" 11 "2014" 12 "2015",  angle(45)) ///
ms(m) color(eltblue) ciopts(recast(rcap) color(eltblue eltblue) lwidth(*0.75 *1.25)) ylabel(-75(25)75, angle(horizotal))  graphregion(color(white)) msize(small) levels(95 90) ytitle("") title("") legend(rows(1))
gr export "$folder/Figures/FigureA4_c.png" , replace 

********--------  Analysis on Capital expenditures	--------********

quietly xtreg capital_ext_PC S##anno i.region_year P $controls7_int if abs(P)<3000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), fe vce(cluster codcom)
est store reg1
quietly xtreg capital_ext_PC S##anno i.region_year P $controls7_int if abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), fe vce(cluster codcom)
est store reg2
quietly xtreg capital_ext_PC S##anno i.region_year P $controls7_int if abs(P)<2000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), fe vce(cluster codcom)
est store reg3

coefplot (reg1, base offset(0) color(black) ciopts(recast(rcap) color(black black) lwidth(*0.75 *1.25)) label("BW: 3,000")) (reg2, offset(0.1) color(midblue) ciopts(recast(rcap) color(midblue midblue) lwidth(*0.75 *1.25)) label("BW: 2,500")) (reg3, offset(0.2) label("BW: 2,000")), vertical omitted keep(1.S#*.anno*)  yline(0) xline(9, lcolor(gray) lpattern(dash)) xlabel(1 "2004" 2 "2005" 3 "2006" 4 "2007" 5 "2008" 6 "2009" 7 "2010" 8 "2011" 9 "2012" 10 "2013" 11 "2014" 12 "2015",  angle(45)) ///
ms(m) color(eltblue) ciopts(recast(rcap) color(eltblue eltblue) lwidth(*0.75 *1.25)) ylabel(-150(25)150, angle(horizotal))  graphregion(color(white)) msize(small) levels(95 90) ytitle("") title("") legend(rows(1))
gr export "$folder/Figures/FigureA4_e.png" , replace  

********--------  Analysis on procurement expenditures	--------********

quietly xtreg procurement_amount_PC S##anno i.region_year P $controls7_int if abs(P)<3000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), fe vce(cluster codcom)
est store reg1
quietly xtreg procurement_amount_PC S##anno i.region_year P $controls7_int if abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), fe vce(cluster codcom)
est store reg2
quietly xtreg procurement_amount_PC S##anno i.region_year P $controls7_int if abs(P)<2000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), fe vce(cluster codcom)
est store reg3

coefplot (reg1, base offset(0) color(black) ciopts(recast(rcap) color(black black) lwidth(*0.75 *1.25)) label("BW: 3,000")) (reg2, offset(0.1) color(midblue) ciopts(recast(rcap) color(midblue midblue) lwidth(*0.75 *1.25)) label("BW: 2,500")) (reg3, offset(0.2) label("BW: 2,000")), vertical omitted keep(1.S#*.anno*)  yline(0) xline(4, lcolor(gray) lpattern(dash)) xlabel(1 "2009" 2 "2010" 3 "2011" 4 "2012" 5 "2013" 6 "2014" 7 "2015",  angle(45)) ///
ms(m) color(eltblue) ciopts(recast(rcap) color(eltblue eltblue) lwidth(*0.75 *1.25)) ylabel(-750(250)750, angle(horizotal))  graphregion(color(white)) msize(small) levels(95 90) ytitle("") title("") legend(rows(1))
gr export "$folder/Figures/FigureA4_g.png" , replace  

********--------  Analysis on total expenditures	--------********

quietly xtreg current_cappital_exp_PC S##anno i.region_year P $controls7_int if abs(P)<3000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), fe vce(cluster codcom)
est store reg1
quietly xtreg current_cappital_exp_PC S##anno i.region_year P $controls7_int if abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), fe vce(cluster codcom)
est store reg2
quietly xtreg current_cappital_exp_PC S##anno i.region_year P $controls7_int if abs(P)<2000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), fe vce(cluster codcom)
est store reg3

coefplot (reg1, base offset(0) color(black) ciopts(recast(rcap) color(black black) lwidth(*0.75 *1.25)) label("BW: 3,000")) (reg2, offset(0.1) color(midblue) ciopts(recast(rcap) color(midblue midblue) lwidth(*0.75 *1.25)) label("BW: 2,500")) (reg3, offset(0.2) label("BW: 2,000")), vertical omitted keep(1.S#*.anno*)  yline(0) xline(9, lcolor(gray) lpattern(dash)) xlabel(1 "2004" 2 "2005" 3 "2006" 4 "2007" 5 "2008" 6 "2009" 7 "2010" 8 "2011" 9 "2012" 10 "2013" 11 "2014" 12 "2015",  angle(45)) ///
ms(m) color(eltblue) ciopts(recast(rcap) color(eltblue eltblue) lwidth(*0.75 *1.25)) ylabel(-150(25)150, angle(horizotal))  graphregion(color(white)) msize(small) levels(95 90) ytitle("") title("") legend(rows(1))
gr export "$folder/Figures/FigureA4_i.png" , replace  


********************************************************************************
****----					Analysis: DID (second column) 				----**** 
********************************************************************************

********--------  Estimates	--------********

********--------  Tax rate

foreach j in house_tax_ordinary {
quietly reghdfe `j'  S##T P  i.region_year population_anagrafe_V##post_2012 $controls7_int if abs(P)<1000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_1000_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year population_anagrafe_V##post_2012 $controls7_int if abs(P)<1200 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_1200_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year population_anagrafe_V##post_2012 $controls7_int if abs(P)<1400 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_1400_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year population_anagrafe_V##post_2012 $controls7_int if abs(P)<1600 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_1600_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year population_anagrafe_V##post_2012 $controls7_int if abs(P)<1800 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_1800_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year population_anagrafe_V##post_2012 $controls7_int if abs(P)<2000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_2000_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year population_anagrafe_V##post_2012 $controls7_int if abs(P)<2200 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_2200_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year population_anagrafe_V##post_2012 $controls7_int if abs(P)<2400 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_2400_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year population_anagrafe_V##post_2012 $controls7_int if abs(P)<2600 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_2600_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year population_anagrafe_V##post_2012 $controls7_int if abs(P)<2800 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_2800_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year population_anagrafe_V##post_2012 $controls7_int if abs(P)<3000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_3000_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year population_anagrafe_V##post_2012 $controls7_int if abs(P)<3200 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_3200_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year population_anagrafe_V##post_2012 $controls7_int if abs(P)<3400 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_3400_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year population_anagrafe_V##post_2012 $controls7_int if abs(P)<3600 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_3600_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year population_anagrafe_V##post_2012 $controls7_int if abs(P)<3800 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_3800_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year population_anagrafe_V##post_2012 $controls7_int if abs(P)<4000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_4000_`j'_FCR_int.dta", replace)
}

********--------  Analysis on Current/Capita/Total expenditures

foreach j in current_exp_PC capital_ext_PC current_cappital_exp_PC{
quietly reghdfe `j'  S##T P  i.region_year $controls7_int if abs(P)<1000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_1000_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year $controls7_int if abs(P)<1200 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_1200_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year $controls7_int if abs(P)<1400 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_1400_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year $controls7_int if abs(P)<1600 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_1600_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year $controls7_int if abs(P)<1800 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_1800_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year $controls7_int if abs(P)<2000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_2000_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year $controls7_int if abs(P)<2200 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_2200_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year $controls7_int if abs(P)<2400 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_2400_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year $controls7_int if abs(P)<2600 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_2600_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year $controls7_int if abs(P)<2800 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_2800_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year $controls7_int if abs(P)<3000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_3000_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year $controls7_int if abs(P)<3200 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_3200_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year $controls7_int if abs(P)<3400 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_3400_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year $controls7_int if abs(P)<3600 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_3600_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year $controls7_int if abs(P)<3800 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_3800_`j'_FCR_int.dta", replace)
quietly reghdfe `j'  S##T P  i.region_year $controls7_int if abs(P)<4000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
parmest, saving("$folder/Data/estimates/est_4000_`j'_FCR_int.dta", replace)
}

********--------  Analysis on procurement expenditures

foreach j in procurement_amount_PC{
quietly reghdfe `j' S##T P i.region_year $controls7_int if abs(P)<1000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) cluster(codcom)
parmest, saving("$folder/Data/estimates/est_1000_`j'_FCR_int.dta", replace)
quietly reghdfe `j' S##T P i.region_year $controls7_int if abs(P)<1200 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) cluster(codcom)
parmest, saving("$folder/Data/estimates/est_1200_`j'_FCR_int.dta", replace)
quietly reghdfe `j' S##T P i.region_year $controls7_int if abs(P)<1400 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) cluster(codcom)
parmest, saving("$folder/Data/estimates/est_1400_`j'_FCR_int.dta", replace)
quietly reghdfe `j' S##T P i.region_year $controls7_int if abs(P)<1600 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) cluster(codcom)
parmest, saving("$folder/Data/estimates/est_1600_`j'_FCR_int.dta", replace)
quietly reghdfe `j' S##T P i.region_year $controls7_int if abs(P)<1800 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) cluster(codcom)
parmest, saving("$folder/Data/estimates/est_1800_`j'_FCR_int.dta", replace)
quietly reghdfe `j' S##T P i.region_year $controls7_int if abs(P)<2000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) cluster(codcom)
parmest, saving("$folder/Data/estimates/est_2000_`j'_FCR_int.dta", replace)
quietly reghdfe `j' S##T P i.region_year $controls7_int if abs(P)<2200 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) cluster(codcom)
parmest, saving("$folder/Data/estimates/est_2200_`j'_FCR_int.dta", replace)
quietly reghdfe `j' S##T P i.region_year $controls7_int if abs(P)<2400 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) cluster(codcom)
parmest, saving("$folder/Data/estimates/est_2400_`j'_FCR_int.dta", replace)
quietly reghdfe `j' S##T P i.region_year $controls7_int if abs(P)<2600 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) cluster(codcom)
parmest, saving("$folder/Data/estimates/est_2600_`j'_FCR_int.dta", replace)
quietly reghdfe `j' S##T P i.region_year $controls7_int if abs(P)<2800 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) cluster(codcom)
parmest, saving("$folder/Data/estimates/est_2800_`j'_FCR_int.dta", replace)
quietly reghdfe `j' S##T P i.region_year $controls7_int if abs(P)<3000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) cluster(codcom)
parmest, saving("$folder/Data/estimates/est_3000_`j'_FCR_int.dta", replace)
quietly reghdfe `j' S##T P i.region_year $controls7_int if abs(P)<3200 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) cluster(codcom)
parmest, saving("$folder/Data/estimates/est_3200_`j'_FCR_int.dta", replace)
quietly reghdfe `j' S##T P i.region_year $controls7_int if abs(P)<3400 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) cluster(codcom)
parmest, saving("$folder/Data/estimates/est_3400_`j'_FCR_int.dta", replace)
quietly reghdfe `j' S##T P i.region_year $controls7_int if abs(P)<3600 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) cluster(codcom)
parmest, saving("$folder/Data/estimates/est_3600_`j'_FCR_int.dta", replace)
quietly reghdfe `j' S##T P i.region_year $controls7_int if abs(P)<3800 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) cluster(codcom)
parmest, saving("$folder/Data/estimates/est_3800_`j'_FCR_int.dta", replace)
quietly reghdfe `j' S##T P i.region_year $controls7_int if abs(P)<4000 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) cluster(codcom)
parmest, saving("$folder/Data/estimates/est_4000_`j'_FCR_int.dta", replace)
}

********-------- Figures --------******** 

********--------  Tax rate

preserve
foreach j in house_tax_ordinary {
use "$folder/Data/estimates/est_1000_`j'_FCR_int.dta", clear
append using "$folder/Data/estimates/est_1200_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_1400_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_1600_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_1800_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2000_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2200_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2400_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2600_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2800_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3000_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3200_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3400_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3600_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3800_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_4000_`j'_FCR_int.dta"

qui keep if parm=="1.S#1.T"
qui gen sign=stderr*1.654
qui gen min90=estimate-sign
qui gen max90=estimate+sign
qui keep estimate min95 max95 min90 max90

qui gen h=.
qui replace h=1000 if _n==1
qui replace h=1200 if _n==2
qui replace h=1400 if _n==3
qui replace h=1600 if _n==4
qui replace h=1800 if _n==5
qui replace h=2000 if _n==6
qui replace h=2200 if _n==7
qui replace h=2400 if _n==8
qui replace h=2600 if _n==9
qui replace h=2800 if _n==10
qui replace h=3000 if _n==11
qui replace h=3200 if _n==12
qui replace h=3400 if _n==13
qui replace h=3600 if _n==14
qui replace h=3800 if _n==15
qui replace h=4000 if _n==16

twoway rcap min95 max95 h, color(black black) lwidth(*0.75) ||rcap min90 max90 h, color(black black) lwidth(*1.25) || connected estimate h, graphregion(color(white)) lpattern(dash) lcolor(grey) mcolor(black) ///
ylabel(-.1(.025).1, angle(horizontal)) xlabel(1000(200)4000,  angle(45)) legend(off) title("") xtitle("Bandwidth") yline(0)
gr export "$folder/Figures/FigureA4_b.png" , replace 
}
restore

********--------  Analysis on Current/Capita/Total expenditures

preserve
foreach j in current_exp_PC {
use "$folder/Data/estimates/est_1000_`j'_FCR_int.dta", clear
append using "$folder/Data/estimates/est_1200_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_1400_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_1600_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_1800_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2000_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2200_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2400_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2600_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2800_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3000_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3200_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3400_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3600_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3800_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_4000_`j'_FCR_int.dta"

qui keep if parm=="1.S#1.T"
qui gen sign=stderr*1.654
qui gen min90=estimate-sign
qui gen max90=estimate+sign
qui keep estimate min95 max95 min90 max90

qui gen h=.
qui replace h=1000 if _n==1
qui replace h=1200 if _n==2
qui replace h=1400 if _n==3
qui replace h=1600 if _n==4
qui replace h=1800 if _n==5
qui replace h=2000 if _n==6
qui replace h=2200 if _n==7
qui replace h=2400 if _n==8
qui replace h=2600 if _n==9
qui replace h=2800 if _n==10
qui replace h=3000 if _n==11
qui replace h=3200 if _n==12
qui replace h=3400 if _n==13
qui replace h=3600 if _n==14
qui replace h=3800 if _n==15
qui replace h=4000 if _n==16

twoway rcap min95 max95 h, color(black black) lwidth(*0.75) ||rcap min90 max90 h, color(black black) lwidth(*1.25) || connected estimate h, graphregion(color(white)) lpattern(dash) lcolor(grey) mcolor(black) ///
ylabel(-75(25)75, angle(horizontal)) xlabel(1000(200)4000,  angle(45)) legend(off) title("") xtitle("Bandwidth") yline(0)
gr export "$folder/Figures/FigureA4_d.png" , replace 
}
restore

preserve
foreach j in capital_ext_PC {
use "$folder/Data/estimates/est_1000_`j'_FCR_int.dta", clear
append using "$folder/Data/estimates/est_1200_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_1400_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_1600_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_1800_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2000_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2200_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2400_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2600_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2800_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3000_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3200_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3400_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3600_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3800_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_4000_`j'_FCR_int.dta"

qui keep if parm=="1.S#1.T"
qui gen sign=stderr*1.654
qui gen min90=estimate-sign
qui gen max90=estimate+sign
qui keep estimate min95 max95 min90 max90

qui gen h=.
qui replace h=1000 if _n==1
qui replace h=1200 if _n==2
qui replace h=1400 if _n==3
qui replace h=1600 if _n==4
qui replace h=1800 if _n==5
qui replace h=2000 if _n==6
qui replace h=2200 if _n==7
qui replace h=2400 if _n==8
qui replace h=2600 if _n==9
qui replace h=2800 if _n==10
qui replace h=3000 if _n==11
qui replace h=3200 if _n==12
qui replace h=3400 if _n==13
qui replace h=3600 if _n==14
qui replace h=3800 if _n==15
qui replace h=4000 if _n==16

twoway rcap min95 max95 h, color(black black) lwidth(*0.75) ||rcap min90 max90 h, color(black black) lwidth(*1.25) || connected estimate h, graphregion(color(white)) lpattern(dash) lcolor(grey) mcolor(black) ///
ylabel(-150(50)150, angle(horizontal)) xlabel(1000(200)4000,  angle(45)) legend(off) title("") xtitle("Bandwidth") yline(0)
gr export "$folder/Figures/FigureA4_f.png" , replace 
}
restore

preserve
foreach j in current_cappital_exp_PC {
use "$folder/Data/estimates/est_1000_`j'_FCR_int.dta", clear
append using "$folder/Data/estimates/est_1200_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_1400_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_1600_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_1800_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2000_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2200_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2400_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2600_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2800_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3000_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3200_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3400_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3600_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3800_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_4000_`j'_FCR_int.dta"

qui keep if parm=="1.S#1.T"
qui gen sign=stderr*1.654
qui gen min90=estimate-sign
qui gen max90=estimate+sign
qui keep estimate min95 max95 min90 max90

qui gen h=.
qui replace h=1000 if _n==1
qui replace h=1200 if _n==2
qui replace h=1400 if _n==3
qui replace h=1600 if _n==4
qui replace h=1800 if _n==5
qui replace h=2000 if _n==6
qui replace h=2200 if _n==7
qui replace h=2400 if _n==8
qui replace h=2600 if _n==9
qui replace h=2800 if _n==10
qui replace h=3000 if _n==11
qui replace h=3200 if _n==12
qui replace h=3400 if _n==13
qui replace h=3600 if _n==14
qui replace h=3800 if _n==15
qui replace h=4000 if _n==16

twoway rcap min95 max95 h, color(black black) lwidth(*0.75) ||rcap min90 max90 h, color(black black) lwidth(*1.25) || connected estimate h, graphregion(color(white)) lpattern(dash) lcolor(grey) mcolor(black) ///
ylabel(-150(50)150, angle(horizontal)) xlabel(1000(200)4000,  angle(45)) legend(off) title("") xtitle("Bandwidth") yline(0)
gr export "$folder/Figures/FigureA4_l.png" , replace 
}
restore

********--------  Analysis on procurement expenditures

preserve
foreach j in procurement_amount_PC{
use "$folder/Data/estimates/est_1000_`j'_FCR_int.dta", clear
append using "$folder/Data/estimates/est_1200_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_1400_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_1600_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_1800_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2000_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2200_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2400_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2600_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_2800_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3000_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3200_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3400_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3600_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_3800_`j'_FCR_int.dta"
append using "$folder/Data/estimates/est_4000_`j'_FCR_int.dta"

qui keep if parm=="1.S#1.T"
qui gen sign=stderr*1.654
qui gen min90=estimate-sign
qui gen max90=estimate+sign
qui keep estimate min95 max95 min90 max90

qui gen h=.
qui replace h=1000 if _n==1
qui replace h=1200 if _n==2
qui replace h=1400 if _n==3
qui replace h=1600 if _n==4
qui replace h=1800 if _n==5
qui replace h=2000 if _n==6
qui replace h=2200 if _n==7
qui replace h=2400 if _n==8
qui replace h=2600 if _n==9
qui replace h=2800 if _n==10
qui replace h=3000 if _n==11
qui replace h=3200 if _n==12
qui replace h=3400 if _n==13
qui replace h=3600 if _n==14
qui replace h=3800 if _n==15
qui replace h=4000 if _n==16

twoway rcap min95 max95 h, color(black black) lwidth(*0.75) ||rcap min90 max90 h, color(black black) lwidth(*1.25) || connected estimate h, graphregion(color(white)) lpattern(dash) lcolor(grey) mcolor(black) ///
ylabel(-750(250)750, angle(horizontal)) xlabel(1000(200)4000,  angle(45)) legend(off) title("") xtitle("Bandwidth") yline(0)
gr export "$folder/Figures/FigureA4_h.png" , replace 
}
restore




